﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ControlsLib;
using GestionePolveriLib.BL;
using GestionePolveriLib.Facades;
using Be.Timvw.Framework.ComponentModel;

namespace GestionePolveri2
{
    public partial class AnagraficaPartite : AnagraficaPartiteBase
    {
        public AnagraficaPartite()
        {
            InitializeComponent();
        }

        public override void InitializeForm()
        {
            base.InitializeForm();

            if (!this.DesignMode)
            {
                this.EnableSorting = true;
                this.ShowPanelMessage = false;
                this.CanModify = true;

                LoadPartite(false);
            }
        }

        private void LoadPartite(bool selectLast)
        {
            PartiteFacade pf = new PartiteFacade();

            pf.LoadAsync((result) =>
            {
                this.Datasource = result;
            });
        }
    }

    public class AnagraficaPartiteBase : AnagraficaManager<PartitaInfo> { }
}
